--[[
	Copyright (C) Udorn (Blackhand)
	
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.	
--]]

vendor.SellPriceMsgTask = {}
vendor.SellPriceMsgTask.prototype = {}
vendor.SellPriceMsgTask.metatable = {__index = vendor.SellPriceMsgTask.prototype}

local L = vendor.Locale.GetInstance()

--[[ 
	Creates a new instance.
--]]
function vendor.SellPriceMsgTask:new(num)
	local instance = setmetatable({}, self.metatable)
	instance.num = num
	return instance
end

--[[
	Run function of the task, performs the scan.
--]]
function vendor.SellPriceMsgTask.prototype:Run()
	if (vendor.Vendor.version ~= vendor.Vendor.db.profile.denySubmit) then
		vendor.Vendor:Print(L["Your help is needed. You have %d new or updated sell prices. Type \"/am submit\" for more information. Type \"/am deny_submit\" to get rid off this message."]:format(self.num))
	end
end

--[[
	Cancels the task and leaves it as soon as possible. 
--]]
function vendor.SellPriceMsgTask.prototype:Cancel()
	-- not cancelable
end

--[[
	Returns whether the task was canecelled.
--]]
function vendor.SellPriceMsgTask.prototype:IsCancelled()
	return false;
end

--[[
	Will be called by the TaskQueue, if the task has failed with an 
	unexpected error.
--]]
function vendor.SellPriceMsgTask.prototype:Failed()
	-- no failure
end
